import { useState, useEffect } from 'react'
import request from '../api/request'
const Index = (url: string, params?: any) => {
    const [data, setData] = useState(null)
    useEffect(() => {
        request.get(url, { params }).then(res => {
            setData(res.data)
        })
    }, [url])
    return data
}
export default Index